package panda.transaction.recovery;

import panda.log.BasicLogRecord;

public class RollbackRecord implements LogRecord {
	private int transactionNumber;

	public RollbackRecord(BasicLogRecord record) {
		transactionNumber = record.getInt();
	}
	
	public RollbackRecord(int transactionNumber) {
		this.transactionNumber = transactionNumber;
	}

	public int getTransactionNumber() {
		return transactionNumber;
	}

	public int getType() {
		return ROLLBACK;
	}

	public void undo(int transactionNumber) {
	}

	public int writeToLog() {
		return logManager.append(new Object[]{ROLLBACK,transactionNumber});
	}

}
